package com.ucode.hrm.service.impl;

import cn.hutool.core.util.ObjUtil;
import com.ucode.hrm.mapper.HrmJobPostApplyRecordMapper;
import com.ucode.hrm.service.HrmJobPostApplyRecordService;
import com.ucode.model.hrm.HrmJobPostApplyRecord;
import com.ucode.tool.util.IdentifyUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

@Service
public class HrmJobPostApplyRecordServiceImpl implements HrmJobPostApplyRecordService {

    @Resource
    private HrmJobPostApplyRecordMapper jobPostApplyRecordMapper;

    @Override
    public HrmJobPostApplyRecordMapper initMapper() {
        return jobPostApplyRecordMapper;
    }

    @Override
    public Long insert(HrmJobPostApplyRecord hrmJobPostApplyRecord) {
        if(ObjUtil.isNull(hrmJobPostApplyRecord.getId()))
            hrmJobPostApplyRecord.setId(IdentifyUtils.getDefaultSnowflakeId());

        jobPostApplyRecordMapper.insert(hrmJobPostApplyRecord);

        return hrmJobPostApplyRecord.getId();
    }
}
